home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 June
/
Macworld (1999-06).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop2.0.sea
/
MacZoop2.0
/
Required Classes
/
ZoopUtilities.h
< prev
next >
Wrap
Text File
|
1999-02-23
|
3KB
|
123 lines
/*************************************************************************************************
*
*
* MacZoop 2.0 - "the framework for the rest of us"
*
*
*
* ZoopUtilities.h -- general utilities
*
*
*
*
*
* © 1999, Graham Cox
*
*
*
*
*************************************************************************************************/
#pragma once
#ifndef __ZOOPUTILITIES__
#define __ZOOPUTILITIES__
extern Rect gZoomFXSourceRect;
typedef enum
{
ntMinimalAlert = 0,
ntAlertPlaySound = 1,
ntAlertDisplayMessage = 2,
ntAlertDefault = 3
}
NTAlertFlags;
// note that NotifyAlert assumes:
#define kApplicationIconSuiteID 128
#define kNotificationSoundID 128
// assertion reporting:
void AssertErr( long lineNo, char* srcName, char* reason, long val );
// handy basic pascal string utilities
void CopyPString( ConstStr255Param srcString, Str255 destString );
void ConcatPStrings( Str255 root, ConstStr255Param append );
void CopyPStringTrunc( ConstStr255Param srcString, Str255 destString, unsigned char ccLim );
void ConcatPStringsTrunc( Str255 root, ConstStr255Param append, unsigned char ccLim );
void CopyCToPString( char* cStringIn, Str255 pStringOut );
// standard function to determine if a GrafPort is colour or b/w
Boolean IsColourPort( GrafPtr aPort );
// global func to set current port to black/white
void SetPortBlackWhite();
// utility function to set hilite mode for invert ops
void SetHiliteMode();
// check for drag manager including linkage check:
Boolean MacHasDM();
// get pixel depth of main screen
short GetMainScreenDepth();
// Alert posting function that will handle notification if app suspended, Use wherever you would
// otherwise use Alert. Default flags give typical behaviour, you can pass others to modify
// behaviour.
// posting function- use it instead of Alert():
short NotifyAlert( const short alertID, NTAlertFlags flags = ntAlertDefault );
// simple delay function (try to avoid delays since they waste time!).
// MZWait will handle events while counting off the ticks, so can be more cooperative than
// MZDelay though less accurate due to event latency.
void MZDelay( short ticks );
void MZWait( unsigned short ticks );
// functions for setting up the global zoom FX source rect:
void SetGlobalZoomSource( Rect* aGlobalRect );
void SetLocalZoomSource( Rect* aLocalRect );
Boolean EqualMem( void* a, void* b, const unsigned long length );
Boolean EqualHandle( Handle a, Handle b );
void Scale2Rects( Rect *theRect, Rect *refRect );
// function to convert real numbers to strings
void RealToString( const double num, Str255& str, short decPlaces = 3 );
// functions for drawing 3D effect rectangles:
void FrameGrayRect( Rect* aRect );
void EtchGrayRect( Rect* aRect );
// "marching ants" utils:
void ShiftPattern( Pattern* aPat );
void AntsRegion( RgnHandle aRgn );
// balloon help util:
void BalloonHelpRefresh();
#endif